clear all

** Open data set called "data.dta"
*use...

* Table A6
summarize corona_hjaelp, detail
* 50% percentile/median = 6

gen corona_hjaelp_group=.
replace corona_hjaelp_group = 1 if corona_hjaelp > 6 & corona_hjaelp !=.
replace corona_hjaelp_group = 0 if corona_hjaelp <= 6 & corona_hjaelp !=.
* 0 = less willing to help 
* 1 = more willing to help

summarize corona_sanktion, detail
* 50% percentile/median = 4
gen corona_sanktion_group=.
replace corona_sanktion_group = 1 if corona_sanktion > 4 & corona_sanktion !=.
replace corona_sanktion_group = 0 if corona_sanktion <=4 & corona_sanktion !=.
* 1 = more willing to sanction
* 0 = less willing to sanction

tabstat kon erfaring alder brugerorientering, by(corona_hjaelp_group) stat(mean sd n)
tabstat kon erfaring alder brugerorientering, by(corona_sanktion_group) stat(mean sd n)

ttest kon, by(corona_hjaelp_group)
ttest alder, by(corona_hjaelp_group) // higher mean age in the group more willing to help 
ttest erfaring, by(corona_hjaelp_group)
ttest brugerorientering, by(corona_hjaelp_group) // higher mean user orientation in the group more willing to help 

ttest kon, by(corona_sanktion_group)
ttest alder, by(corona_sanktion_group)
ttest erfaring, by(corona_sanktion_group)
ttest brugerorientering, by(corona_sanktion_group) // higher mean user orientation in the group less willing to sanction  

* Table A7
summarize corona_hjaelp, detail
gen corona_hjaelp_group_25 = .
replace corona_hjaelp_group_25 = 1 if corona_hjaelp >= 8 & corona_hjaelp !=. 
replace corona_hjaelp_group_25 = 0 if corona_hjaelp <= 5 & corona_hjaelp !=. 

summarize corona_sanktion, detail
gen corona_sanktion_group_25=.
replace corona_sanktion_group_25 = 1 if corona_sanktion >= 7 & corona_sanktion !=.
replace corona_sanktion_group_25 = 0 if corona_sanktion <= 1 & corona_sanktion !=.

tabstat kon erfaring alder brugerorientering, by(corona_hjaelp_group_25) stat(mean sd n)
tabstat kon erfaring alder brugerorientering, by(corona_sanktion_group_25) stat(mean sd n)

ttest kon, by(corona_hjaelp_group_25)
ttest alder, by(corona_hjaelp_group_25) // higher mean age in the group more willing to help 
ttest erfaring, by(corona_hjaelp_group_25)
ttest brugerorientering, by(corona_hjaelp_group_25) // higher mean user orientation in the group more willing to help 

ttest kon, by(corona_sanktion_group_25)
ttest alder, by(corona_sanktion_group_25)
ttest erfaring, by(corona_sanktion_group_25)
ttest brugerorientering, by(corona_sanktion_group_25) // marginally higher mean user orientation in the group less willing to sanction 

* Table A8
summarize corona_hjaelp corona_sanktion, detail
gen corona_hjaelp_sanktion_group=.
replace corona_hjaelp_sanktion_group = 1 if corona_hjaelp <= 5 & corona_hjaelp ! = . & corona_sanktion >=7 & corona_sanktion !=.
replace corona_hjaelp_sanktion_group = 0 if corona_hjaelp >=8 & corona_hjaelp !=. & corona_sanktion <=1 & corona_sanktion !=.

tabstat kon erfaring alder brugerorientering, by(corona_hjaelp_sanktion_group) stat(mean sd n)

ttest kon, by(corona_hjaelp_sanktion_group)
ttest alder, by(corona_hjaelp_sanktion_group) // higher mean age in the group more willing to help AND less willing to sanction 
ttest erfaring, by(corona_hjaelp_sanktion_group)
